import { request } from '@/utils'

export default {
  // 获取角色列表
  getRoleList: (params = {}) => request.get('/sys/role/page', { params }),

  // 添加或更新角色
  updateRole: (params = {}) => request.post('/sys/role/add_or_update', params),

  // 删除角色
  delRole: (params = {}) => request.post('/sys/role/delete', params),

  // 获取角色权限
  getRoleTree: (params = {}) =>
    request.get('/sys/role/ownResource', { params }),

  // 获取权限树
  getTree: (params = {}) => request.get('/sys/menu/tree', { params }),
}
